package com.ems.util;

import lombok.Getter;
import lombok.Setter;

import java.util.List;
import java.util.Objects;
@Getter
@Setter
public class Response {
        private Integer code;
        private String msg;
        private String token;
        private List data;


        public Response(Integer code, String msg, String token, List data) {
            this.code = code;
            this.msg = msg;
            this.token = token;
            this.data = data;
        }

        @Override
        public String toString() {
            return "Response{" +
                    "code=" + code +
                    ", msg='" + msg + '\'' +
                    ", token='" + token + '\'' +
                    ", data='" + data + '\'' +
                    '}';
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Response response = (Response) o;
            return Objects.equals(code, response.code) &&
                    Objects.equals(msg, response.msg) &&
                    Objects.equals(token, response.token)&&
                    Objects.equals(data, response.data);
        }

        @Override
        public int hashCode() {
            return Objects.hash(code, msg, token, data);
        }
    }
